# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=minizip
pkgver=1.2.12
pkgrel=0
pkgdesc="a library for manipulation with files from .zip archives"
arch="all"
license="Zlib"
url="https://zlib.net/"
makedepends="automake autoconf libtool zlib-dev"
subpackages="$pkgname-static $pkgname-dev"
options="!check" # No testsuite
source="https://zlib.net/zlib-$pkgver.tar.xz
	zlib-1.2.8-minizip-include.patch"

builddir="$srcdir/zlib-$pkgver"/contrib/minizip

# secfixes:
#   1.2.12-r0:
#     - CVE-2018-25032

prepare() {
	default_prepare
	autoreconf -fi
}

build() {
	./configure \
		--prefix=/usr \
		--enable-static=yes
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
12940e81e988f7661da52fa20bdc333314ae86a621fdb748804a20840b065a1d6d984430f2d41f3a057de0effc6ff9bcf42f9ee9510b88219085f59cbbd082bd  zlib-1.2.12.tar.xz
d325818f4674c7aff9e97a6446b01197d89149803b1994441fdcdbdd216206184085cb841bac73dd87472c386335b07283a28cbf852766acd99d55c63f32112d  zlib-1.2.8-minizip-include.patch
"
